<?php

class Kd_Data_Dcl_Expression_Select extends Kd_Data_Dcl_Expression_Base {

    private $_isAll = FALSE;
    private $_isDistinct = FALSE;

    public function  __construct() {
        parent::__construct();
    }

    public function getIsDistinct(){
        return $this->_isDistinct;
    }

    public function getIsAll(){
        return $this->_isAll;
    }

    public function distinct(){
        $this->_isDistinct = TRUE;
        return $this;
    }

    public function all(){
        $this->_isAll = TRUE;
        return $this;
    }

    public function fields(){
        $args = func_get_args();
        foreach($args as $i ){
            $this->field($i);
        }
        return $this;
    }

    public function field($name, $alias = ''){
        $this->_isAll = FALSE;
        return $this->addExpression(new Kd_Data_Dcl_Expression_Select_Field($name, $alias));
    }

    public function getExpressionType(){
        return 'select';
    }
}